package cn.edu.scau.cmi.liujiaming.chapter05;

public class Geometry {
	Rectangle rect;
	Circle circle;
	Geometry(Rectangle rect,Circle circle){
		this.rect=rect;
		this.circle=circle;
	}
	void setRectanglePosition(double x,double y) {
		rect.setX(x);
		rect.setY(y);
	}
	void setRectangleWidthAndHeight(double w,double h) {
		rect.setWidth(w);
		rect.setHeight(h);
	}
	void setCirclePosition(double x,double y) {
		circle.setX(x);
		circle.setY(y);
	}
	void setCircleRaduis(double r) {
		circle.setRadius(r);
	}
	void showState() {
		double circleX=circle.getX();
		double rectX=rect.getX();
		if(rectX>circleX+circle.radius) {
			System.out.println("矩形在圆的右侧");
		}	
		if(rectX+rect.width<circleX-circle.radius) {
			System.out.println("矩形在圆的左侧");
		}
	}

}
